import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({
  routes: [{
    path: '/mobile',
    name: 'mobile',
    redirect: '/mobile/index',
    component: () => import(/* webpackChunkName: "mobile" */ './views/mobile/MobileIndex.vue'),
    children: [{
      path: 'index',
      name: 'mIndex',
      component: () => import(/* webpackChunkName: "mIndex" */ './views/mobile/Index.vue'),
      meta : {
        title:'乐淘云购'
      }
    },
    {
      path: 'category',
      name: 'mcategory',
      component: () => import(/* webpackChunkName: "mcategory" */ './views/mobile/Category.vue'),
      meta: {
        title: '分类'
      }
    },
    {
      path: 'cart',
      name: 'mcart',
      component: () => import(/* webpackChunkName: "mcart" */ './views/mobile/Cart.vue'),
      meta: {
        title: '购物车'
      }
    },
    {
      path: 'user',
      name: 'muser',
      component: () => import(/* webpackChunkName: "muser" */ './views/mobile/User.vue'),
      meta: {
        title: '个人中心'
      }
    
    },
    {
      path: 'login',
      name: 'login',
      component: () => import(/* webpackChunkName: "login" */ './views/mobile/login.vue'),
      meta: {
        title: '登陆'
      }

      },
    {
      path: 'search',
      name: 'msearch',
      component: () => import(/* webpackChunkName: "mlogin" */ './views/mobile/Search.vue'),
      meta: {
        title: '搜索'
      }
    },
    {
      path: 'product/:id',
      name: 'product',
      component: () => import(/* webpackChunkName: "mlogin" */ './views/mobile/product.vue'),
      meta: {
        title: '商品详情'
      }
    }
     
    ]
  },
  
  {
    path: '/manage',
    name: 'manage',
    component: () => import(/* webpackChunkName: "about" */ './views/manage/ManageIndex.vue')
  }
  ]
})
